/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.ejemplo.DAO;

import com.ejemplo.entity.Producto;

import org.hibernate.SessionFactory;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;

/**
 *
 * @author CARLOS
 */
@Repository
public class ProductoDAO extends HibernateDaoSupport implements ProductoDAOInterface{
    
    @Autowired
    public ProductoDAO(SessionFactory sessionFactory){
        super.setSessionFactory(sessionFactory);
    }

    @Override
    public boolean insertarActualizaProducto(Producto t) {
        boolean b=false;
        try{
            getHibernateTemplate().saveOrUpdate(t);
            b=true;
        }catch(Exception e){
            e.printStackTrace();
        }
        return b;
    }

   
    
}
